package main

import (
	"reflect"
	"fmt"
	"unsafe"
	"unicode/utf8"
	"time"
)

func main() {
	s:=[5]int{1,2,3}
	s1:=&s
	s2:=new([]int)
	s3:=make([]int,0)
	s4:=s[:]
	kind1 := reflect.ValueOf(s).Kind()
	kind2 := reflect.ValueOf(s1).Kind()
	kind3 := reflect.ValueOf(s2).Kind()
	kind4 := reflect.ValueOf(s3).Kind()
	kind5 := reflect.ValueOf(s4).Kind()
	fmt.Println(kind1)
	fmt.Println(kind2)
	fmt.Println(kind3)
	fmt.Println(kind4)
	fmt.Println(kind5)
	fmt.Printf("%p \n",s2)
	fmt.Printf("%p \n",&s2)
	fmt.Printf("s2 is %v, %p \n",*s2,s2)
	fmt.Print(*s2)
	fmt.Println(s3)

	var st1 string
	var st3 string
	var st2 string ="hello 世界"

	fmt.Println(len(st2))
	fmt.Println(utf8.RuneCountInString(st2))

	for _, value := range st2 {
		fmt.Printf(" %T , %c\n",value,value)
	}

	now:=time.Now()
	fmt.Println("Now ",now)
	fmt.Println(now.Format(time.RFC822))

	ptr:=&st2
	*ptr="23"
	fmt.Println("str ",st2)
	fmt.Println("str ",st2)
	fmt.Println(st1)
	fmt.Println(&st1)
	fmt.Println(&st3)
	fmt.Println(&st2)
	fmt.Println(st2)

	fmt.Println(unsafe.Sizeof(&st1))
	fmt.Println(unsafe.Sizeof(&st2))
	fmt.Println(unsafe.Sizeof(s4))
	fmt.Println(unsafe.Sizeof(s))


}
